﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace EPiServer.Labs.MobilePack.Site.modules.MobilePack
{
    /// <summary>
    /// Summary description for Manifest
    /// </summary>
    public class Manifest : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            HttpRequest request = context.Request;
            HttpResponse response = context.Response;
            response.ContentType = "text/cache-manifest";
            response.WriteFile("/MobilePack.manifest");
            HttpContext.Current.Response.Cache.SetAllowResponseInBrowserHistory(false);
            HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.NoCache);
            HttpContext.Current.Response.Cache.SetNoStore();
            response.Cache.SetExpires(DateTime.Now.AddSeconds(60));
            response.Cache.SetValidUntilExpires(true);
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}